import Vue from 'vue'
import App from './App.vue'
import router from './router'

import Router from 'vue-router';
import config from '@/config';
import i18n from '@/locale'
import Auth from '@/libs/wechat';
import scroll from "@/libs/loading";

// 导入样式
import 'view-design/dist/styles/iview.css'
import './index.less'
import '@/assets/icons/iconfont.css'
import '@/assets/iconfont/iconfont.css'
import './assets/iconfontYI/iconfontYI.css'
import './plugin/emoji-awesome/css/google.min.css';
import './styles/index.less'
import 'vue-happy-scroll/docs/happy-scroll.css'

import store from './store'
import iView from 'iview'
// 懒加载
import VueLazyload from 'vue-lazyload'
// 移动端滚动插件

import vuescroll from 'vuescroll';
import * as tools from "@/libs/tools";

//日期
import moment from 'moment'
Vue.prototype.$moment = moment
moment.locale('zh-cn')


const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location) 
}

Vue.config.productionTip = false

Vue.prototype.bus = new Vue();
Vue.prototype.$wechat = Auth;
Vue.prototype.$scroll = scroll;
Vue.prototype.$tools = tools;
Vue.use(iView, {
  i18n: (key, value) => i18n.t(key, value)
});

Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require('./assets/images/no.png'),
  loading: require('./assets/images/moren.jpg'),
  attempt: 1,
  listenEvents: ['scroll', 'wheel', 'mousewheel', 'resize', 'animationend', 'transitionend', 'touchmove']
});

/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config;
 
 
Vue.use(vuescroll);


new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
